package com.ktgj.flight.api;

import com.ktgj.common.core.constant.ServiceNameConstants;
import com.ktgj.common.core.domain.R;
import com.ktgj.common.core.web.domain.AjaxResult;
import com.ktgj.flight.api.domain.*;
import com.ktgj.flight.api.factory.RemoteFlightFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(contextId = "RemoteFlightService", name = ServiceNameConstants.Flight_SERVICE, fallbackFactory = RemoteFlightFallbackFactory.class)
public interface RemoteFlightService {

    @GetMapping(value = "/terminal/{terminalId}")
    public R<AirportTerminalApi> getAirportTerminal(@PathVariable("terminalId") Long terminalId);

    @PostMapping("/terminal/queryStartTerminal")
    public String queryStartTerminal(@RequestParam("terminalId") Long terminalId);

    @PostMapping("/airport/queryAirPortName")
    public String queryAirPortName(@RequestParam("airportId") String airportId);

    @PostMapping("/infotickets/queryFlightOrderTrip")
    public Map<String, Object> queryFlightOrderTrip(@RequestParam("orderId") Long orderID);

    @PostMapping("/flight/getFlightInfoLists")
    public List<FlightResponseVoApi> getFlightInfoListBySearchConditions(@RequestBody MoFlightSearchRequestApi searchRequest);

    @PostMapping("/airliner/queryAirlinerByAirlinerId")
    public String queryAirlinerByAirlinerId(@RequestParam("airlinerId") String airlinerId);

    @PostMapping("/flight/getFightInfoByAirCodeAndDate")
    public FightStopResVoApi getFightInfoByAirCodeAndDate(@RequestBody FightStopReqVoApi vo);

    /**
     * 查询订单列表（机票）远
     * */
    @PostMapping("/infos/checkTheTicketList")
    public List<TicketOrderApi> checkTheTicketList(@RequestParam("customerId") Long customerId);

    /**
     * 定制行程-单程
     * @param customerId
     * @return
     */
    @PostMapping("/infotickets/queryInfoTickets")
    public Map<String, Object> queryInfoTickets(@RequestParam("customerId") Long customerId);

    /**
     * 获取用户有多少机票订单
     */
    @PostMapping("/infos/queryFlightOrderNumber")
    public int queryFlightOrderNumber(@RequestBody Long customerId);

    /**
     * 行程机票订单
     * */
    @PostMapping("/infos/journeyFlightOrderInfo")
    public JourneyFlightOrderInfoVoApi journeyFlightOrderInfo(@RequestBody Map<String, Object> map);

    /**
     * 获取城市三字码
     * */
    @PostMapping("/airport/selectAirportLike")
    public List<AirportApi> selectAirportLike(@RequestBody Map<String, Object> map);

    /**
     * 获取城市名称
     * */
    @PostMapping("/airport/selectAirportName")
    public List<AirportApi> selectAirportName(@RequestBody Map<String, Object> map);

    /**
     * 机票订单(远成)
     * */
    @PostMapping("/infos/selFlightOrderInfoById")
    public List<FlightOrderInfoTicketsApi> selFlightOrderInfoById(@RequestBody Map<String, Object> map);

    /**
     * 机票订单(远成)---无id
     * */
    @PostMapping("/infos/selFlightOrderInfo")
    public List<FlightOrderInfoTicketsApi> selFlightOrderInfo(@RequestBody FlightOrderInfoTickets flightOrderInfoTickets);

//    /**
//     * 三字码获取机场名称
//     * */
//    @PostMapping("/airport/getAirportInfoByAirportName")
//    public AirportApi airportName(Map<String, Object> map);
    /**
     * 机场名称获取三字码
     * */
    @PostMapping("/airport/getAirportInfoByAirportName")
    public AirportApi getAirportInfoByAirportName(Map<String, Object> map);

    /**
     * 获取机场名称
     * */
    @PostMapping("/airport/airportNameById")
    public String airportNameById(@RequestBody Map<String, Object> map);

    /**
     * 获取航站楼详细信息（远程）
     */
    @PostMapping("/terminal/getInfoById")
    public AirportTerminalApi getInfoById(@RequestBody Map<String, Object> map);

    /**
     * 获取航站楼id
     */
    @PostMapping("/terminal/getInfoByName")
    public AirportTerminalApi getInfoByName(@RequestBody Map<String, Object> map);

    /**
     * 获取机票预订_机票订单基本信息详细信息
     */
    @PostMapping(value = "/infos/getInfo")
    public R<FlightOrderInfo> getInfo(@RequestBody Map<String, Long> map);

    /**
     * 修改机票预订_机票订单基本信息
     */
    @PostMapping("/infos/edit")
    public R<AjaxResult> edit(@RequestBody FlightOrderInfo flightOrderInfo);

    /**
     * 退票订单列表
     * */
    @PostMapping("/change/refundList")
    public List<FlightOrderChange> refundList(@RequestBody Map<String, Object> map);

    /**
     * 获取支付订单列表
     * */
    @PostMapping("/infos/payList")
    public List<FlightOrderInfo> payList(@RequestBody Map<String, Object> map);

    /**
     * 查询机票预订_机票订单机票明细列表
     * @param flightOrderInfoTickets
     * @return
     */
    @PostMapping("/infotickets/orderInfoTicketsList")
    public List<FlightOrderInfoTickets> orderInfoTicketsList(@RequestBody FlightOrderInfoTickets flightOrderInfoTickets);

    /**
     * 查询机票预订_机票退改签订单机票信息列表
     * @param flightOrderChangeTickets
     * @return
     */
    @PostMapping("/tickets/orderChangeTicketsList")
    public List<FlightOrderChangeTickets> orderChangeTicketsList(FlightOrderChangeTickets flightOrderChangeTickets);

    /**
     * 回填票号
     * */
    @PostMapping("/infotickets/backfillTicketNumber")
    public int backfillTicketNumber(@RequestBody Map<String, Object> map);

    /**
     * 回填备注
     * */
    @PostMapping("/infos/backfillRemarks")
    public int backfillRemarks(@RequestBody Map<String, Object> map);

    /**
     * 代码获取航司名（远程）
     * */
    @PostMapping("/airliner/airlinerName")
    public String airlinerName(@RequestBody Map<String, Object> map);

    /**
     * 订单号获取机票订单信息（远程）
     * */
    @PostMapping("/infos/order")
    public FlightOrderInfo order(@RequestBody Map<String, Object> map);

    /**
     * 机票订单详细（远程）
     * */
    @PostMapping("/infotickets/order")
    public boolean orderDetails(@RequestBody Map<String, Object> map);

    /**
     * 机票订单列表（CRM）
     * @param order
     * @return
     */
    @PostMapping("/infos/orderList")
    public List<FlightOrderListVO> orderList(@RequestBody FlightOrderDTOCRM order);

    @PostMapping("/infos/flightOrderListThings")
    public List<FlightOrderList> orderListThings();

    /**
     * 获取航站楼详细信息
     * @param map
     * @return
     */
    @PostMapping("/flightTerminal/getInfo")
    public R<Terminal> flightTerminalGetInfo(@RequestBody Map<String, Object> map);
}
